Skip to content

New: rule prefer-replace-text #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 24, 2017

Conversation

aladdin-add
Copy link
Contributor

No description provided.

@not-an-aardvark not-an-aardvark self-requested a review October 22, 2017 21:20
create(context) {
context.report({
fix(fixer) {
// error, can be writen: return fixer.replaceText([node, '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: the word "written" is spelled incorrectly here. Also, the comment here is missing a ].


create (context) {
const sourceCode = context.getSourceCode();
const message = 'prefer using replaceText instead of replaceTextRange.';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I think it would be better to make the message:

const message = 'Use replaceText instead of replaceTextRange.';

@aladdin-add aladdin-add merged commit f0d27d5 into eslint-community:master Oct 24, 2017
@aladdin-add aladdin-add deleted the issue47 branch October 24, 2017 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants